﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.plaf.basic.border {
    import flash.display.*;
    import flash.geom.*;
    import org.aswing.*;
    import flash.filters.*;
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.graphics.*;

    public class ComboBoxPopupBorder implements Border, UIResource {

        protected var shape:Shape;

        public function ComboBoxPopupBorder(){
            this.shape = new Shape();
        }
        public function updateBorder(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
            var _local4:ASColor;
            var _local7:ASColor;
            var _local8:Number;
            this.shape.graphics.clear();
            _arg2 = new Graphics2D(this.shape.graphics);
            _local4 = _arg1.getBackground();
            _local4 = _local4.changeAlpha(1);
            var _local5:StyleTune = _arg1.getStyleTune();
            var _local6:StyleResult = new StyleResult(_local4, _local5);
            _local7 = _local6.bdark;
            _local8 = _local6.round;
            var _local9:ASColor = _local4.changeLuminance((_local4.getLuminance() - 0.07));
            var _local10:ASColor = _local4.changeLuminance((_local4.getLuminance() + 0.01));
            _arg3 = _arg3.clone();
            _arg3.width = (_arg3.width - 4);
            _arg3.height = (_arg3.height - 4);
            var _local11:SolidBrush = new SolidBrush(_local4);
            _arg2.fillRoundRect(new SolidBrush(_local7), _arg3.x, _arg3.y, _arg3.width, _arg3.height, _local8);
            _arg3.grow(-1, -1);
            --_local8;
            if (_local8 < 0){
                _local8 = 0;
            };
            _arg2.fillRoundRect(new SolidBrush(_local10), _arg3.x, _arg3.y, _arg3.width, _arg3.height, _local8);
            _arg3.grow(-1, -1);
            var _local12:Matrix = new Matrix();
            _local12.createGradientBox(_arg3.width, _arg3.height, (Math.PI / 2), _arg3.x, _arg3.y);
            if (_local8 < 0){
                _local8 = 0;
            };
            _arg2.fillRoundRect(new GradientBrush(GradientBrush.LINEAR, [_local9.getRGB(), _local4.getRGB()], [1, 1], [0, 100], _local12), _arg3.x, _arg3.y, _arg3.width, _arg3.height, _local8);
            this.shape.filters = [new DropShadowFilter(1, 45, 0, 0.3, 4, 4)];
        }
        public function getBorderInsets(_arg1:Component, _arg2:IntRectangle):Insets{
            return (new Insets(2, 2, 6, 6));
        }
        public function getDisplay(_arg1:Component):DisplayObject{
            return (this.shape);
        }

    }
}//package org.aswing.plaf.basic.border 
